package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SystemDeptMapper;
import com.ruoyi.system.domain.SystemDept;
import com.ruoyi.system.service.ISystemDeptService;

/**
 * 部门Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-17
 */
@Service("systemSystemDeptServiceImpl")
public class SystemDeptServiceImpl implements ISystemDeptService 
{
    @Autowired
    private SystemDeptMapper systemDeptMapper;

    /**
     * 查询部门
     * 
     * @param id 部门主键
     * @return 部门
     */
    @Override
    public SystemDept selectSystemDeptById(Long id)
    {
        return systemDeptMapper.selectSystemDeptById(id);
    }

    /**
     * 查询部门列表
     * 
     * @param systemDept 部门
     * @return 部门
     */
    @Override
    public List<SystemDept> selectSystemDeptList(SystemDept systemDept)
    {
        return systemDeptMapper.selectSystemDeptList(systemDept);
    }

    /**
     * 新增部门
     * 
     * @param systemDept 部门
     * @return 结果
     */
    @Override
    public int insertSystemDept(SystemDept systemDept)
    {
        systemDept.setCreateTime(DateUtils.getNowDate());
        return systemDeptMapper.insertSystemDept(systemDept);
    }

    /**
     * 修改部门
     * 
     * @param systemDept 部门
     * @return 结果
     */
    @Override
    public int updateSystemDept(SystemDept systemDept)
    {
        systemDept.setUpdateTime(DateUtils.getNowDate());
        return systemDeptMapper.updateSystemDept(systemDept);
    }

    /**
     * 批量删除部门
     * 
     * @param ids 需要删除的部门主键
     * @return 结果
     */
    @Override
    public int deleteSystemDeptByIds(Long[] ids)
    {
        return systemDeptMapper.deleteSystemDeptByIds(ids);
    }

    /**
     * 删除部门信息
     * 
     * @param id 部门主键
     * @return 结果
     */
    @Override
    public int deleteSystemDeptById(Long id)
    {
        return systemDeptMapper.deleteSystemDeptById(id);
    }
}
